package BanyuanClub.Work.Day0309.练习.烤汉堡;

public class Waiter{
    private int sheng;
    private int shou;

    public void setShou(int shou) {
        this.shou = shou;
    }

    public int getShou() {
        return shou;
    }

    public void kao(){
         new Thread(() -> {
            try {
                int n = 0;
                for (int j = 0; j < 4; j++) {
                    for (int i = 1; i <= 5; i++) {
                        Thread.sleep(1000);
                        n += 1;
                        if (i < 5){
                            sheng += 1;
                            System.out.println("秦始皇做了一个汉堡");
                        }else {
                            sheng += 1;
                            System.out.println("秦始皇做了一个汉堡");
                            sheng -= 5;
                            shou += 5;
                            System.out.println("烤箱烤好了5个汉堡");
                        }
                    }
                }
                System.out.println("秦始皇烤了" + n + "个汉堡");
                System.out.println("还剩" + shou + "个汉堡");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
    }


}
